package spring.security.dto;

import java.util.Date;

import javax.validation.constraints.Past;

import org.hibernate.validator.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonView;

import spring.security.validator.MyConstraint;

public class User {

	private String id;
	
	@MyConstraint(message="测试数据")
	private String userName;

	@NotBlank(message="密码不能为空")
	private String password;
	
	@Past(message="生日必须是过去时间")
	private Date birthDay;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@JsonView(UserSimpleView.class)
	public Date getBirthDay() {
		return birthDay;
	}

	public void setBirthDay(Date birthDay) {
		this.birthDay = birthDay;
	}

	@JsonView(UserSimpleView.class)
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@JsonView(UserDateilView.class)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	
	public interface UserSimpleView{};
	
	public interface UserDateilView extends UserSimpleView {};
	
}
